package cn.edu.xcu.ckl.service.impl;

import cn.edu.xcu.ckl.domain.CarInfo;
import cn.edu.xcu.ckl.domain.OrderInfo;
import cn.edu.xcu.ckl.domain.ProductInfo;
import cn.edu.xcu.ckl.domain.UserInfo;
import cn.edu.xcu.ckl.mapper.UserInfoMapper;
import cn.edu.xcu.ckl.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service(value = "userInfoService")
public class UserInfoServiceImpl implements UserInfoService {

    @Autowired
    UserInfoMapper userInfoMapper;

    @Override
    public int register(UserInfo userInfo) {
        return userInfoMapper.register(userInfo);
    }

    @Override
    public UserInfo login(UserInfo userInfo) {
        return userInfoMapper.login(userInfo);
    }

    @Override
    public int pwd(UserInfo userInfo) {
        return userInfoMapper.edit(userInfo);
    }

    @Override
    public List<ProductInfo> queryProductList(String product_type) {
        return userInfoMapper.queryProductList(product_type);
    }

    @Override
    public int addCar(CarInfo carInfo) {
        return userInfoMapper.addCar(carInfo);
    }

    @Override
    public CarInfo isAddCar(CarInfo carInfo) {
        return userInfoMapper.isAddCar(carInfo);
    }

    @Override
    public int updateCar(CarInfo carInfo) {
        return userInfoMapper.updateCar(carInfo);
    }

    @Override
    public List<CarInfo> queryCarByUsername(String username) {
        return userInfoMapper.queryCarByUsername(username);
    }

    @Override
    public int delCarById(int car_id) {
        return userInfoMapper.delCarById(car_id);
    }

    @Override
    public int createOrder(List<OrderInfo> list) {
        return userInfoMapper.createOrder(list);
    }

    @Override
    public List<OrderInfo> queryOrderByUsername(String username) {
        return userInfoMapper.queryOrderByUsername(username);
    }

    @Override
    public int clearCarByUsername(List<CarInfo> list) {
        return userInfoMapper.clearCarByUsername(list);
    }

    @Override
    public int delOrderById(int orderId) {
        return userInfoMapper.delOrderById(orderId);
    }

    @Override
    public int delProduct(int _id) {
        return userInfoMapper.delProduct(_id);
    }

    @Override
    public int editProduct(ProductInfo productInfo) {
        return userInfoMapper.editProduct(productInfo);
    }

    @Override
    public int addProduct(ProductInfo productInfo) {
        return userInfoMapper.addProduct(productInfo);
    }

    @Override
    public List<ProductInfo> queryProductTypeList() {
        return userInfoMapper.queryProductTypeList();
    }

    @Override
    public int delProductTypeById(int product_id) {
        return userInfoMapper.delProductTypeById(product_id);
    }

    @Override
    public int editProductType(ProductInfo productInfo) {
        return userInfoMapper.editProductType(productInfo);
    }

    @Override
    public int addProductType(ProductInfo productInfo) {
        return userInfoMapper.addProductType(productInfo);
    }

    @Override
    public ProductInfo isProductType(String product_title) {
        return userInfoMapper.isProductType(product_title);
    }

}
